<template>
  <div>
    <button @click="handleClick">计数器</button>
    <!-- optionsAPI -->
    <!-- <span block>{{ store.count }}</span> -->
    <!-- setupAPI -->
    <span block>{{ store.count }}</span>
    <span block>{{ store.doubleCount }}</span>
  </div>
</template>
<script lang="ts" setup>
import { useCounterStore } from "@/stores/counter"
const store = useCounterStore()
// optionsAPI
// const handleClick = () => {
//   store.changeCount(5)
// }

// setupAPI
const handleClick = () => {
  store.changeCount(5).then((res) => {
    console.log(res)
  })
}
</script>
